package net.cz.wc.util;

import net.cz.wc.olddto.ThreeGCFields;

public class DataUtils {
	public static ThreeGCFields extractThreeGCFields(String stringData) {
		//697816K->165396K(699072K)
		
		ThreeGCFields fields = new ThreeGCFields();
		
		int currIndex = stringData.indexOf("K");
		
		fields.setCurrentUsage(stringData.substring(0, currIndex));
		fields.setUsageAfterGC(stringData.substring(currIndex + 3, stringData.indexOf("K", currIndex + 3)));
		fields.setTotalSize(stringData.substring(stringData.indexOf("(") + 1, stringData.indexOf(")") - 1));
		
		return fields;
	}
}
